#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
const int N = 1e5 + 10;
int a[N], prexor[N], cnt[N];

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    ll n; cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) prexor[i] = prexor[i - 1] ^ a[i];
    cnt[0] = 1;
    ll ans = n * (n + 1) / 2;
    for (int i = 1; i <= n; i++) {
        for (int j = 0; j <= 200; j++) {
            ll sq = j * j;
            ans -= cnt[prexor[i] ^ sq];
        }
        cnt[prexor[i]]++;
    }
    cout << ans << endl;
    return 0;
}